package com.wifiview.config;

import android.content.Context;
import android.media.MediaPlayer;
import android.util.Log;

import com.wifiview.R;

public class Media {

    private final String TAG = "Media";
    private MediaPlayer mpShtter = null;

    public Media(Context context) {
        mpShtter = MediaPlayer.create(context, R.raw.shutter);
    }

    public void playShutter() {
        try {
            if (mpShtter != null) {
                mpShtter.stop();
            }
            mpShtter.prepare();
            mpShtter.start();
            Log.e(TAG, "media play shutter!");
        } catch (Exception e) {
            Log.e(TAG, "music error");
            e.printStackTrace();
        }
    }
}
